package com.tengol.demo.design.pattern.creational.prototype.singleton;

/**
 * 饿汉式单例模式
 *
 * @author dongrui
 * @date 2019/03/05
 */
public class HungrySingleton implements Cloneable{
    private static HungrySingleton INSTANCE;

    static {
        INSTANCE = new HungrySingleton();
    }

    private HungrySingleton(){

    }

    public static HungrySingleton getInstance(){
        return INSTANCE;
    }

    @Override
    public Object clone() {
        return INSTANCE;
    }
}
